<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!--忽略页面中的邮箱格式为邮箱-->
    <meta name="format-detection" content="email=no">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no,address=no,email=no">
    <title>选择地图</title>
    <style>
        .search-wrap .search-bar {
        }
    </style>
    <script src="../js/jquery-2.1.1.min.js"></script>
</head>
<body>
<div style="width: 100%;height: 465px">
    <iframe id="mapPage" width="100%" height="100%" frameborder=0
            src="http://apis.map.qq.com/tools/locpicker?search=1&type=1&key=LPTBZ-MBE3K-D5PJG-ANJ6J-QFLLJ-AYBVA&referer=myapp">
    </iframe>
</div>
</body>
<script>
    //获取用户的选择的地址
    //    $(function () {
    //        $("#suggestionScroller .poi-list ul li").click(function () {
    //            var bbb = $("#suggestionScroller .poi-list ul li .poi-address").text();
    //            alert(bbb);
    //        })
    //    })
    window.addEventListener('message', function (event) {
        // 接收位置信息，用户选择确认位置点后选点组件会触发该事件，回传用户的位置信息lat: 40.013135, lng: 116.322034
        var loc = event.data;
        if (loc && loc.module == 'locationPicker') {//防止其他应用也会向该页面post信息，需判断module是否为'locationPicker'
            console.log('location', loc);
            //alert(JSON.stringify(loc))
//            alert(loc.poiaddress)
            var aaa = loc.poiaddress;
            console.log(aaa)
//            $("#searchword").val(aaa)
        }
    }, false);
</script>
</html>